package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author:Simple
 * @Date: 2025/8/25 11:27
 * @Description:
 **/
@FeignClient(value = "service-product",fallback = ProductDegradeFeignClient .class)
public interface ProductFeignClient {
    /**
     * @author: Simple
     * @date: 2025/8/25 11:31
     * @description:  skuId 获取sku信息
     */
    @GetMapping("inner/getSkuInfo/{skuId}")
    SkuInfo getAttrValueList(@PathVariable("skuId") Long skuId);
    /**
     * @author: Simple
     * @date: 2025/8/25 11:32
     * @description:三级分类id获取分类视图
     */
    @GetMapping("inner/getCategoryView/{category3Id}")
    BaseCategoryView getCategoryView(@PathVariable(name = "category3Id")Long category3Id);
    /**
     * @author: Simple
     * @date: 2025/8/25 11:32
     * @description:获取sku价格 根据skuId
     */
    @GetMapping("inner/getSkuPrice/{skuId}")
    BigDecimal getSkuPrice(@PathVariable(name = "skuId")Long skuId);
    /**
     * @author: Simple
     * @date: 2025/8/25 11:32
     * @description:根据spuId获取属性 并选中skuId下的一对属性
     */
    @GetMapping("inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
    List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable(name = "skuId")Long skuId,
                                                          @PathVariable(name = "spuId")Long spuId);
    /**
     * 根据spuId 查询map 集合属性
     * @param spuId
     * @return
     */
    @GetMapping("inner/getSkuValueIdsMap/{spuId}")
    Map getSkuValueIdsMap(@PathVariable("spuId") Long spuId);
    /**
     * @author: Simple
     * @date: 2025/8/25 11:34
     * @description:spuid 获取spu海报信息
     */
    @GetMapping("inner/findSpuPosterBySpuId/{spuId}")
    List<SpuPoster> findSpuPosterBySpuId(@PathVariable(name = "spuId")Long spuId);
    /**
     * @author: Simple
     * @date: 2025/8/25 11:35
     * @description:skuId获取属性
     */
    @GetMapping("inner/getAttrList/{skuId}")
    List<BaseAttrInfo> getAttrList(@PathVariable(name = "skuId")Long skuId);
}
